package ch8;

import java.util.Scanner;

public class test {
    public static void main(String[] args) {
        Scanner scan=new Scanner(System.in);
        int[] num = {1,5,8,79,9,11,75,7,789,7412,321,5,6,92,10,95,852,741,3,203};
        int temp = 0;
        for (int i = 0; i < num.length - 1; i++) {
            for (int j = 0; j < num.length - 1 - i; j++) {
                if (num[j] >= num[j + 1]) {
                    temp = num[j + 1];
                    num[j + 1] = num[j];
                    num[j] = temp;
                }
            }
        }
        for (int i = 0; i < num.length; i++){
            System.out.print(num[i]+" ");
        }
        System.out.println();
        System.out.println("第二大的数是"+num[18]);

    }
}